package work.mediway.mdm.biz.service.biz.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import org.springframework.stereotype.Service;

import work.mediway.mdm.core.page.QueryRequest;
import work.mediway.mdm.biz.service.biz.SsModelInfoService;
import work.mediway.mdm.biz.entity.biz.SsModelInfo;
import work.mediway.mdm.biz.mapper.biz.SsModelInfoMapper;

@Service
public class SsModelInfoServiceImpl extends ServiceImpl<SsModelInfoMapper, SsModelInfo> implements SsModelInfoService {

    @Override
    public Page<SsModelInfo> getByModelInfo(SsModelInfo ssModelInfo, QueryRequest queryRequest) {
        Page<SsModelInfo> page = new Page<>(queryRequest.getCurrent(), queryRequest.getSize());
        page.setRecords(this.baseMapper.getByModelInfo(page, ssModelInfo));
        return page;
    }

    @Override
    public Page<SsModelInfo> pageModelInfoAll(QueryRequest queryRequest) {
        Page<SsModelInfo> page = new Page<>(queryRequest.getCurrent(), queryRequest.getSize());
        page.setRecords(this.baseMapper.listModelInfoAll(page));
        return page;
    }
}
